<!-- 分页 -->
<template>
  <div class="pagination" v-if="total>1">
    <el-pagination background layout="prev, pager, next" :total="total" @current-change="handleCurrentChange"></el-pagination>
  </div>
</template>

<script>
export default {
  props: {
    total: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {};
  },
  methods: {
      handleCurrentChange(val) {
        this.$emit('pageChange',val)
      }
  }
};
</script>
<style lang='scss' scoped>
.pagination {
  width: 100%;
  text-align: center;
  margin: 20px 0;
}
</style>